/*
 * Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package top.continew.admin.asset.service;

import org.apache.ibatis.annotations.Param;
import top.continew.admin.asset.model.entity.DeviceDiscardDO;
import top.continew.admin.asset.model.entity.DeviceLendDO;
import top.continew.admin.asset.model.entity.DeviceUseDO;
import top.continew.admin.asset.model.req.DeviceTracksReq;
import top.continew.starter.extension.crud.service.BaseService;
import top.continew.admin.asset.model.query.DeviceRecordsQuery;
import top.continew.admin.asset.model.req.DeviceRecordsReq;
import top.continew.admin.asset.model.resp.DeviceRecordsDetailResp;
import top.continew.admin.asset.model.resp.DeviceRecordsResp;

import java.util.List;

/**
 * 设备清单业务接口
 *
 * @author CharlieYan
 * @since 2025/03/18 10:12
 */
public interface DeviceRecordsService extends BaseService<DeviceRecordsResp, DeviceRecordsDetailResp, DeviceRecordsQuery, DeviceRecordsReq> {

    /**
     * 根据类型查询设备品牌
     *
     * @param categoryId
     * @return 设备品牌
     */
    List<String> getDeviceBrandByCategoryId(@Param("categoryId") Long categoryId);

    /**
     * 根据邮箱查询设备型号
     *
     * @param categoryId
     * @return 设备型号
     */
    List<String> getDeviceModelByCategoryId(@Param("categoryId") Long categoryId);

    /**
     * 撤销删除
     * 
     * @param deviceId
     */
    Integer deleteReturn(Long deviceId);

    /**
     * 分配用户
     * 
     * @param useDO
     */
    Integer deviceUse(DeviceUseDO useDO);

    /**
     * 借用
     * 
     * @param lendDO
     */
    Integer deviceLend(DeviceLendDO lendDO);

    /**
     * 归还
     * 
     * @param lendDO
     */
    Integer deviceReturn(DeviceLendDO lendDO);

    /**
     * 报废
     * 
     * @param discardDO
     */
    Integer deviceDiscard(DeviceDiscardDO discardDO);

    /**
     * 撤销报废
     * 
     * @param discardDO
     */
    Integer deviceDiscardCancel(DeviceDiscardDO discardDO);

    /**
     * 维护
     * 
     * @param req
     */
    void deviceMaintenance(DeviceTracksReq req);

}